package com.shu.lock;

import java.util.concurrent.locks.LockSupport;

/**
 * @author ssm
 * @version V1.0
 * @description:
 * @date 2021/7/28 11:32
 */

public class LockSupportTest {


    public static void main(String[] args) {
        System.out.println("main start");
        Myt myt = new Myt();
        myt.start();
        // LockSupport.unpark(myt);
        myt.interrupt();
        System.out.println("main over");
    }

    public static class Myt extends Thread {

        @Override
        public void run() {
            System.out.println("进入线程");
            LockSupport.park();
            System.out.println(Thread.currentThread().isInterrupted());
            Thread.interrupted();
            System.out.println(Thread.currentThread().isInterrupted());
            LockSupport.park();
            System.out.println("进入线程");
        }
    }

}
